import yaml
from pathlib import Path


def load_config(env_type: str) -> dict:
    """加载对应环境的配置文件"""
    config_path = Path(__file__).parent.parent / f"configs/{env_type}.yaml"
    if not config_path.exists():
        raise FileNotFoundError(f"配置文件 {config_path} 不存在")

    with open(config_path, 'r') as f:
        return yaml.safe_load(f)